package com.platform.hjt.erp.model;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ErpOrderInfoDetail entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "erp_order_info_detail")
public class ErpOrderInfoDetail implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -5863495548811138041L;
	private ErpOrderInfoDetailId id;
	private ErpGoodInfo erpGoodInfo;
	private ErpOrderInfo erpOrderInfo;
	private Double count;
	private Double price;

	// Constructors

	/** default constructor */
	public ErpOrderInfoDetail() {
	}

	/** minimal constructor */
	public ErpOrderInfoDetail(ErpOrderInfoDetailId id, ErpGoodInfo erpGoodInfo,
			ErpOrderInfo erpOrderInfo) {
		this.id = id;
		this.erpGoodInfo = erpGoodInfo;
		this.erpOrderInfo = erpOrderInfo;
	}

	/** full constructor */
	public ErpOrderInfoDetail(ErpOrderInfoDetailId id, ErpGoodInfo erpGoodInfo,
			ErpOrderInfo erpOrderInfo, Double count, Double price) {
		this.id = id;
		this.erpGoodInfo = erpGoodInfo;
		this.erpOrderInfo = erpOrderInfo;
		this.count = count;
		this.price = price;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "erpGoodInfoId", column = @Column(name = "erp_good_info_id", nullable = false, length = 32)),
			@AttributeOverride(name = "erpOrderInfoId", column = @Column(name = "erp_order_info_id", nullable = false, length = 32)) })
	public ErpOrderInfoDetailId getId() {
		return this.id;
	}

	public void setId(ErpOrderInfoDetailId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "erp_good_info_id", nullable = false, insertable = false, updatable = false)
	public ErpGoodInfo getErpGoodInfo() {
		return this.erpGoodInfo;
	}

	public void setErpGoodInfo(ErpGoodInfo erpGoodInfo) {
		this.erpGoodInfo = erpGoodInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "erp_order_info_id", nullable = false, insertable = false, updatable = false)
	public ErpOrderInfo getErpOrderInfo() {
		return this.erpOrderInfo;
	}

	public void setErpOrderInfo(ErpOrderInfo erpOrderInfo) {
		this.erpOrderInfo = erpOrderInfo;
	}

	@Column(name = "count", precision = 22, scale = 0)
	public Double getCount() {
		return this.count;
	}

	public void setCount(Double count) {
		this.count = count;
	}

	@Column(name = "price", precision = 22, scale = 0)
	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

}